<?php

include_once ('../utilities.php')

?>
<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" type="text/css" href="../reset.css">
	<link rel="stylesheet" type="text/css" href="../mainStyle.css">
	<link rel="stylesheet" type="text/css" href="../searchButton.css">
	<link rel="stylesheet" type="text/css" href="../tablestyle.css">
	<title>SHPE</title>
</head>
<body>

	<div id="container">
		<?php

$root = '../';
include_once ('../header.php')

?>
        
		<div id="page-body">
			<h1 align="center">Region 5</h1><br></br>
			<?php

echo '<table class = "center">';
$query = "select * FROM Chapters WHERE RegionID = 5";
//$queryID = "select ChapterID FROM Chapters WHERE RegionID = 1";

$data = $mysqli->query($query);
$row = $data->num_rows;

//$dataID = $mysqli->query($queryID);

$i = 0;
if ($data)
{
    for ($j = 0; $j < $row; ++$j)
    {
        echo "<tr>";
        $rows = $data->fetch_array(MYSQLI_ASSOC);
        //$rowsID = $dataID->fetch_row();
        //echo "<td> $rows[$i] </td>";
        echo "<td><a href='" . $root . "chapter/?id=" . $rows["ChapterID"] . "'>" . $rows["ChapterName"] .
            "</a></td>";
        echo "</tr>";
    }
}
echo "</table>";

?>
		</div>
		
		<?php

include_once ('../footer.php')

?>
	</div>

</body>
</html>